Open
Conversation
Propose using the 2 public methods below to allow user to set the maximum duration for capture, a useful feature for camera operation during interview sessions and for second, unattended camera for a budget two-camera shoot. The duration selection will be factored with the selected resolution to calculate and set the maximum filesize. If required filesize exceeds 4GB, initialize a routine that starts the capture, polls for approaching filesize limit, then ends the current capture and starts a new file. This routine is repeated until the requested maximum duration has been reached.
1.public void setMaxDuration (int max_duration_ms)
Added in API level 3
Sets the maximum duration (in ms) of the recording session. Call this after setOutFormat() but before prepare(). After recording reaches the specified duration, a notification will be sent to the MediaRecorder.OnInfoListener with a "what" code of MEDIA_RECORDER_INFO_MAX_DURATION_REACHED and recording will be stopped. Stopping happens asynchronously, there is no guarantee that the recorder will have stopped by the time the listener is notified.
Parameters
max_duration_ms
the maximum duration in ms (if zero or negative, disables the duration limit)
Throws
IllegalArgumentException
2.public void setMaxFileSize (long max_filesize_bytes)
Added in API level 3
Sets the maximum filesize (in bytes) of the recording session. Call this after setOutFormat() but before prepare(). After recording reaches the specified filesize, a notification will be sent to the MediaRecorder.OnInfoListener with a "what" code of MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED and recording will be stopped. Stopping happens asynchronously, there is no guarantee that the recorder will have stopped by the time the listener is notified.
Parameters
max_filesize_bytes
the maximum filesize in bytes (if zero or negative, disables the limit)
Throws
IllegalArgumentException
Collaborator
|
Thanks. We'll take into consideration. We have plans to add some new features in video and will add these settings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Propose using the 2 public methods below to allow user to set the maximum duration for capture, a useful feature for camera operation during interview sessions and for second, unattended camera for a budget two-camera shoot. The duration selection will be factored with the selected resolution to calculate and set the maximum filesize. If required filesize exceeds 4GB, initialize a routine that starts the capture, polls for approaching filesize limit, then ends the current capture and starts a new file. This routine is repeated until the requested maximum duration has been reached.
1.public void setMaxDuration (int max_duration_ms)
Added in API level 3
Sets the maximum duration (in ms) of the recording session. Call this after setOutFormat() but before prepare(). After recording reaches the specified duration, a notification will be sent to the MediaRecorder.OnInfoListener with a "what" code of MEDIA_RECORDER_INFO_MAX_DURATION_REACHED and recording will be stopped. Stopping happens asynchronously, there is no guarantee that the recorder will have stopped by the time the listener is notified.
Parameters
max_duration_ms
the maximum duration in ms (if zero or negative, disables the duration limit)
Throws
IllegalArgumentException
2.public void setMaxFileSize (long max_filesize_bytes)
Added in API level 3
Sets the maximum filesize (in bytes) of the recording session. Call this after setOutFormat() but before prepare(). After recording reaches the specified filesize, a notification will be sent to the MediaRecorder.OnInfoListener with a "what" code of MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED and recording will be stopped. Stopping happens asynchronously, there is no guarantee that the recorder will have stopped by the time the listener is notified.
Parameters
max_filesize_bytes
the maximum filesize in bytes (if zero or negative, disables the limit)
Throws
IllegalArgumentException